<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
    <div class="" id="app">
        <cpn><button slot="btn">插槽</button></cpn>
    </div>
    <template id="cpn">
        <div>
            <h1>组件demo</h1>
            <slot name="btn"><button>默认</button></slot>
        </div>
    </template>
    <script>
        new Vue({
            el:"#app",
            components: {
                cpn:{
                    template:"#cpn"
                }
            },
        })
    </script>
</body>
</html>